--[[/**
-- * 
 * 这个buff加在敌人身上
 * 触发时机,被伤害后
 * 每次受到神圣伤害时, 储存起来
 * [0] 储存万分比
 * [1] 上限(沙利叶生命值的万分比)
-- */]]

---@class BuffEffect634101 : BaseBuffEffect
BuffEffect634101 = ClientFight.CreateClass("BuffEffect634101", ClientFight.BaseBuffEffect)
local t = BuffEffect634101

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local parameters = {...};
 local result = parameters[3];
 if (not result:isDamage()) then
 return IBuffEffect.FAIL;
 end
 if (not AttackUtils.isDamage(result.state)) then
 return IBuffEffect.FAIL;
 end
 local buffEffectValue = buff.buffBean.f_BuffEffectValue;
 local damage = result.damage;
 local addDamage = Utils.calcRatio(damage, buffEffectValue[1]);
 local source = buff.source;
 local maxLimit = Utils.calcRatio(FighterAttributeManager.getFightAttr(source,FighterAttributeEnum.HP),buffEffectValue[1]);
 local storeDamage = source.parametersByObject[SkillEffect634100.SKILL_EFFECT_634100_STORE_DAMAGE] or 0;
 storeDamage = storeDamage +  addDamage;
 if (storeDamage >= maxLimit) then
 storeDamage = maxLimit;
 end
 source.parametersByObject[SkillEffect634100.SKILL_EFFECT_634100_STORE_DAMAGE] =  storeDamage;

 local logstoreDamage = storeDamage;
 SkillRoleMgr.savePathFile( "[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff:"
 .. buff.modelId .." 储存伤害: "..addDamage.. " 已存储总量: "..logstoreDamage);
    return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
end

t.New()